<template>
  <div>
    <h1>工资：{{ money }}</h1>
    <button @click="money += 1000">点击加钱</button>
    <h1>{{ count }}</h1>
    <button @click="count += 1">点击加人</button>
  </div>
</template>

<script setup>
import { watch, ref } from 'vue';

let money = ref(15000);
watch(money, (newVal, old) => {
  console.log(newVal, old);
});

let count = ref(10);
watch([money, count], (val) => {
  console.log(val);
});
</script>
